import { $post, $put, $delete } from '@js/request'

export async function addRequest (d: { [k: string]: any }) {
  const res = await $post('/api/commission/participant', d)
  return res.data
}

export async function updateRequest (d: { [k: string]: any }) {
  const id = d.id
  delete d.id
  const res = await $put(`/api/commission/participant/${id}`, d)
  return res.data
}

export async function delRequest (id: string) {
  const res = await $delete(`/api/commission/participant/${id}`)
  return res.data
}
